package com.warmheart.core.rs.builder;

import javax.validation.constraints.NotNull;

import com.warmheart.core.cors.builder.CoRsBuilder;

class RsWarpper {

    public static <T extends CoRsBuilder<?, ?>> RsWarpper.Builder<T> custom(@NotNull T entity) {
        return new Builder<T>(entity);
    }

    /**
     * 
     * @ClassName: Builder
     * @Description: 查询结果包装建造者
     * @author ZhangJianyang
     * @date 2025-06-16 09:37:02
     *
     * @param <T>
     */
    public static class Builder<T extends CoRsBuilder<?, ?>> {

        /**
         * 核心实体类
         */
        private T entity;

        protected Builder(T entity) {
            this.entity = entity;
        }

        public void singleWarpper(Boolean... distinctFlags) {
            WarpperBuilder.custom(this.entity).single(distinctFlags);
        }

        public void multipleWarpper(Boolean... distinctFlags) {
            WarpperBuilder.custom(this.entity).multiple(distinctFlags);
        }

        public void groupByCnt(Boolean... distinctFlags) {
            WarpperBuilder.custom(this.entity).groupByCnt(distinctFlags);
        }

        public void keyValue(Boolean... distinctFlags) {
            WarpperBuilder.custom(this.entity).keyValue(distinctFlags);
        }
    }
}
